Efficient validation and construction of Knuth–Morris–Pratt arrays
نویسندگان
چکیده
Knuth-Morris-Pratt (KMP) arrays are known as the ”failure function” of the Knuth-Morris-Pratt string matching algorithm. We present an algorithm to check if an integer array is a KMP array. This gives a method for computing all the distinct KMP arrays.
منابع مشابه
Genetic validation of Trypanosoma brucei glutathione synthetase as an 1 essential enzyme 2 3 Chelsea Pratt
متن کامل
Linear Pattern Matching Algorithms
In 1970, Knuth, Pratt, and Morris [1] showed how to do basic pattern matching in linear time. Related problems, such as those discussed in [4], have previously been solved by efficient but sub-optimal algorithms. In this paper, we introduce an interesting data structure called a bi-tree. A linear time algorithm "for obtaining a compacted version of a bi-tree associated with a given string is pr...
متن کاملFactor theory and the unity of opposites
The theory of factors of a regular language is used to illustrate the unity-ofopposites theorem of Galois connections. Left and right factors of a language are characterised as unions of rightand left-invariant equivalence classes, respectively, and this characterisation is exploited in the construction of the factor graph. The factor graph is a representation of the poset of left factors and, ...
متن کاملReconstructing the Knuth-Morris-Pratt algorithm
In my view, the Knuth-Morris-Pratt string searching algorithm is one of those “magic” algorithms that do something wonderful but are difficult to explain or understand in detail without a significant time investment. The pedagogical question that I would like to address is not just: “how does it work?”, or “why does it work?”, or “does it work?”. More importantly, it is: “how did they come up w...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007